#!/bin/bash

# 获取服务器名称
if [ -f ".namelock" ]; then
    SERVER=`cat .namelock`
else
    SERVER="ckwy"
fi

# 检查服务器名称
if [ "${SERVER}" == "" ]
then
        echo "path error!"
        exit 1
fi

# 获取并显示进程信息
PID=`ps aux | grep logic | grep -v grep | grep ${SERVER} | awk '{print $2}'`

if [ "${PID}" != "" ]
then
        echo "Server ${SERVER} is running, PID: ${PID}"
        ps aux | grep logic | grep -v grep | grep --color=always ${SERVER}
else
        echo "Server ${SERVER} is not running."
fi
